# -*- mode: python; -*-

#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#

Import('SandeshEnv')

env = SandeshEnv.Clone();

SRC_PATH = 'pysandesh_example/'
INSTALL_PATH = 'pysandesh_example/'

local_modules = [
                 'setup.py'
                ]

local_modules_rules = []
for module in local_modules:
    local_modules_rules.append(env.Install(Dir('.'), File(module).srcnode()))

pysandesh_example_modules = [
                             '__init__.py',
                             'generator.py',
                             'sandesh_req_impl.py',
                            ]

pysandesh_example_modules_rules = []
for module in pysandesh_example_modules:
    pysandesh_example_modules_rules.append(
        env.Install(Dir(INSTALL_PATH), File(SRC_PATH + module).srcnode()))

gen_msg_pkg = env.SandeshGenPy('pysandesh_example/generator_msg.sandesh', INSTALL_PATH)
gen_msg_pkg+= env.SandeshGenPy('pysandesh_example/vn.sandesh', INSTALL_PATH)
gen_msg_pkg+= env.SandeshGenPy('pysandesh_example/vm.sandesh', INSTALL_PATH)

sdist_depends = [local_modules_rules, pysandesh_example_modules_rules, gen_msg_pkg]
sdist_gen = env.Command('dist', 'setup.py', 'cd ' + Dir('.').path + ' && python setup.py sdist')
env.Depends(sdist_gen, sdist_depends)
